//
//  StatusCellBottomView.swift
//  sinaWeibo
//
//  Created by LSY on 15/12/23.
//  Copyright © 2015年 lsy. All rights reserved.
//

import UIKit
import SnapKit
class StatusCellBottomView: UIView {

    // mark --初始化
    override init(frame:CGRect){
        
        super.init(frame:frame)
        setupUI()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //    设置UI
    func setupUI(){
        //        添加视图
        addSubview(retweetedBtn)
        addSubview(commenBtn)
        addSubview(likeBtn)
//        添加约束
        
        retweetedBtn.snp_makeConstraints { (make) -> Void in
            
            make.top.left.bottom.equalTo(self)

        }
        
       commenBtn.snp_makeConstraints { (make) -> Void in
        
        make.top.bottom.equalTo(self)
        make.left.equalTo(retweetedBtn.snp_right)
        make.width.equalTo(retweetedBtn.snp_width)
        }
        
        likeBtn.snp_makeConstraints { (make) -> Void in
            
//            将按钮三等分
            make.left.equalTo(commenBtn.snp_right)
            make.right.equalTo(self.snp_right)
//            三个按钮等宽
            make.width.equalTo(commenBtn.snp_width)
            make.top.bottom.equalTo(self)
        }
        
        
        let sepView1 = sepView()
        
        let sepView2 = sepView()
        
//        设置宽
        let width :CGFloat = 0.5
//        设置比例系数
        let scale = 0.4
        
        addSubview(sepView1)
        
       addSubview(sepView2)
        
//        设置约束
        sepView1.snp_makeConstraints { (make) -> Void in
//            左边的约束
            make.left.equalTo(retweetedBtn.snp_right)
            make.height.equalTo(self.snp_height).multipliedBy(scale)
            make.centerY.equalTo(self.snp_centerY)
            make.width.equalTo(width)
        }
        
        sepView2.snp_makeConstraints { (make) -> Void in
            make.right.equalTo(likeBtn.snp_left)
            make.height.equalTo(self.snp_height).multipliedBy(scale)
            make.centerY.equalTo(self.snp_centerY)
            make.width.equalTo(width)
        }
    }
    
//   设置分割视图
    private func sepView() -> UIView{
    
        let v : UIView = UIView()
        
        v.backgroundColor = UIColor.darkGrayColor()
        
        return v
        
    }

    //    懒加载视图
    //    转发的按钮
    private  lazy var retweetedBtn : UIButton = UIButton(title: "转发", backImageName:nil, fontSize: 10, color:UIColor.darkGrayColor(),imageName:"timeline_icon_retweet")
    //    评论的按钮
    private  lazy var commenBtn : UIButton = UIButton(title: "评论", backImageName:nil, fontSize: 10, color:UIColor.darkGrayColor(),imageName:"timeline_icon_comment")
    
    //    赞的按钮
    private  lazy var likeBtn : UIButton = UIButton(title: "赞", backImageName:nil, fontSize: 10, color:UIColor.darkGrayColor(),imageName:"timeline_icon_unlike")
    


}
